<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>观众登记</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	
	<script type="text/javascript" src="<%=path%>/JS/extjs/adapter/ext-base.js"></script>
	<script type="text/javascript" src="<%=path%>/JS/extjs/ext-all.js"></script>
	<script type="text/javascript" src="<%=path%>/JS/extjs/ext-lang-zh_CN.js"></script>
	<link rel="stylesheet" type="text/css" href="css/style.css"/>
	
	<script type="text/javascript" src="JS/jquery-1.7.2.js"></script>
	<script type="text/javascript" src="JS/common.js"></script>
	
	
	<style type="text/css">
		*{
		 	margin:0px;
			font-size: 12px;	
		 }
		  .errordiv
		 {
		 	border:2px solid #FF3030;
		 	background-color:#FF8C00;
		 	width:200px;
		 	height:25px
		 }
		 .textcss
		 {
		 	/*width:300px;
		 	border-color: #BFE05D;
		 	height: 25px;
		 	border-style: solid;
		 	height:20px;
			color:#135709;
			border:1px solid #73bce6;
			background-color:#ebfaff;*/
		 	
		 }
		 .submitcss
		 {
		 	font-weight: bold;
		 }
		 .errortextcss
		 {
		 	width:300px;
		 	border-color: red;
		 }
		 .tabletrcss
		 {
		 	height:30px;
		 }
	</style>
	<SCRIPT type="text/javascript">
		$(function(){
			/*$.ajax({  
				url:'adminFindMenu',  
				type:'POST',  
				data:"{}",  
				dataType:'json',
				timeout: 100000,
				async:true,               
				error: function(a){                     
					alert('出错了');                 
				},   
				success:function (data) { 
				}
			}); */
			var qInfo = "<s:property value="#request.audienceQInfo"/>";
			//alert(qInfo);
			var qJson = Ext.util.JSON.decode(qInfo);
			var qtitleStr = qJson.qtitleidarr;
			var qtitleArr = qtitleStr.split(",");
			var qArr = qJson.checksel;
		//	alert("-----------" + Ext.util.JSON.encode(qArr[0]));
			//for(var i=0;i<qtitleArr.length;i++){
				//var qtitleid = qtitleArr[i];
				for(var i=0;i<qArr.length;i++){
					var qtitleid = qArr[i].qtitleid;
					var inputtype = qArr[i].inputtype;
					var qidStr = qArr[i].qidstr;
					//alert(qtitleid + "---------" + qidStr)
					var qidArr = qidStr.split("*");
					//alert(inputtype + "******" + qtitleid +"------" + qidArr[0]);
					for(var j=0;j<qidArr.length;j++){
						//alert(qtitleid +"------" + qidArr[j] + "&&&&&&&&" + this.value)
						if(inputtype == "checkbox"){
							$("[name='"+qtitleid+"']:checkbox").each(function(){
								if(this.value == qidArr[j]){
									this.checked = true;
								}
								if(this.value == '-1'){
									//alert(qArr[i].otherval);
									//alert(Ext.util.JSON.encode(qArr[i].otherval));
									$("#"+qtitleid).attr("value",qArr[i].otherval);
								 }
							});
						}else if(inputtype == "radio"){
							 $("[name='"+qtitleid+"']:radio").each(function() {
								 if(this.value == qidArr[j]){
									 this.checked = true;
								 }
								 if(this.value == '-1'){
									 $("#"+qtitleid).attr("value",qArr[i].otherval);
								 }
							 });
						}
					}
				}
				
			//}

			
		});
	</SCRIPT>
  </head>
  
  <body>
  <center>
  <iframe src="header.jsp" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" width="100%" height="235px"></iframe>
  <form action="audienceRegister" method="post"  onsubmit="return checkInput()">
   <table width="1000px"  border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
   		<tr>
   			<td colspan="2" style="padding-left: 200px" bgcolor="#FFFFFF" class="fontblack" >
   				<b style="font-size: 24px;">观众登记</b>>><a href="${pageContext.request.contextPath}/preAudienceQInfoAction.action" target="_blank">新的注册</a>
   			</td>
   		</tr>
		<tr >
			<td align="right" bgcolor="#FFFFFF" style="fontblack">
				姓名：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_name" name="audience.audience_name" style="width:200px" value="<s:property value="#request.audienceInfo.audience_name"/>"/>
			</td>
		</tr>
		<tr >
			<td align="right" bgcolor="#FFFFFF" style="fontblack">
				性别：
			</td>
			<td align="left" bgcolor="#FFFFFF" style="fontblack">
				<input type="radio" id="audience_sex" name="audience.audience_sex" class="textcss" value="0" checked="<s:if test="#request.audienceInfo.audience_sex == 0">checked</s:if>"/>先生
				<input type="radio" id="audience_sex" name="audience.audience_sex" value="1" checked="<s:if test="#request.audienceInfo.audience_sex == 1">checked</s:if>"/>女士
			</td>
		</tr>
		<tr class="tabletrcss">
			<td align="right" width="25%" bgcolor="#FFFFFF" style="fontblack">
				公司名称：
			</td>
			<td align="left" bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_company" name="audience.audience_company" class="textcss" style="width:300px" value="<s:property value="#request.audienceInfo.audience_company"/>"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				部门：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_department" name="audience.audience_department" class="textcss"  style="width:200px" value="<s:property value="#request.audienceInfo.audience_department"/>"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				职位：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_position" name="audience.audience_position" class="textcss" style="width:200px" value="<s:property value="#request.audienceInfo.audience_position"/>" />
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				地址1：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
			<input type="text" id="audience_address1" name="audience.audience_address1" class="textcss" style="width:300px" value="<s:property value="#request.audienceInfo.audience_address1"/>"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				地址2：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_address2" name="audience.audience_address2" class="textcss" style="width:300px" value="<s:property value="#request.audienceInfo.audience_address2"/>"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				国家/地区：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_nation" name="audience.audience_nation" class="textcss" style="width:200px"  value="<s:property value="#request.audienceInfo.audience_nation"/>"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				省份：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_province" name="audience.audience_province" class="textcss" style="width:200px" value="<s:property value="#request.audienceInfo.audience_province"/>"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				城市：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_city" name="audience.audience_city" class="textcss" style="width:200px" value="<s:property value="#request.audienceInfo.audience_city"/>"/>
			</td>
		</tr>
		
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				邮编：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_postcode" name="audience.audience_postcode" class="textcss" style="width:200px" value="<s:property value="#request.audienceInfo.audience_postcode"/>"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				电话：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
			 <!--  <input name="audience_tel1" type="text" id="audience_tel1" size="4" value="86" />
		      -
		      <input name="audience_tel2" type="text" id="audience_tel2" size="4" />
		      -
		      <input name="audience_tel3" type="text" id="audience_tel3" size="15" /> -->
		      <!-- 将电话拼接 -->
		      <input type="text" name="audience.audience_tel" id="audience_tel" class="textcss" style="width:200px" value="<s:property value="#request.audienceInfo.audience_tel"/>"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				传真：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack" valign="center">
			  <!--<input name="audience_fax1" type="text" id="audience_fax1" size="4" value="86" />
		      -
		      <input name="audience_fax2" type="text" id="audience_fax2" size="4" />
		      -
		      <input name="audience_fax3" type="text" id="audience_fax3" size="15" />-->
		      <input type="text" id="audience_fax" name="audience.audience_fax" class="textcss" style="width:200px" value="<s:property value="#request.audienceInfo.audience_fax"/>"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				手机：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_mobile" name="audience.audience_mobile" class="textcss" style="width:200px" value="<s:property value="#request.audienceInfo.audience_mobile"/>"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				电子邮件：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
					<input type="text" id="audience_Email" name="audience.audience_Email" class="textcss" style="width:200px" value="<s:property value="#request.audienceInfo.audience_Email"/>"/>
			</td> 
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				网址：
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_weburl" name="audience.audience_weburl" class="textcss" style="width:300px" value="<s:property value="#request.audienceInfo.audience_weburl"/>"/>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="left" bgcolor="#FFFFCC" style="fontblack" height="40px">
				请填写问卷调查
				<input type="hidden" name="questioninfo" id="questioninfo"/><!-- 问卷调查的信息 --><s:property value="#audienceInfo.audience_name"/>
			</td>
		</tr>
		
		<s:iterator value="#request.qTitleList" id="qTitle" status="titsataus">
  		<tr>
			<td  align="left"  bgcolor="#FFFFFF" style="fontblack">
			<s:property value="#titsataus.index+1"/>，<s:property value="#qTitle.Qtitle"/>
			<s:if test="#qTitle.isCheckBox == 1">
			（可复选划√）
			</s:if>
			<s:elseif test="#qTitle.isCheckBox == 0">
			（可单选）
			</s:elseif>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
			<input type="hidden" id="qtitle<s:property value="#titsataus.index"/>" value="<s:property value="#qTitle.id"/>"/><!-- 第组大类的id -->
				<table border = "0">
						<tr>
						<td>
							<table>
							<s:iterator value="%{#qTitle.audienceQs}" id="audienceq" status="status">
							<tr>
							<td width="375px">
								<s:if test="#audienceq.isAvalible==1&&#status.index%2==0">
								<s:if test="#qTitle.isCheckBox == 1">
									<input type="checkbox" name="<s:property value="#qTitle.id"/>" value="<s:property value="#audienceq.id"/>" />
								</s:if>
								<s:elseif test="#qTitle.isCheckBox == 0">
									<input type="radio" value="<s:property value="#audienceq.id"/>" name="<s:property value="#qTitle.id"/>"/>
								</s:elseif>
								<!-- <s:property value="#status.index"/>
								<s:property value="#audienceq.id"/> --> 
	  							<s:property value="%{#audienceq.Qtext}"/>  
	  							</s:if>
							</td>
							</tr>
	  						</s:iterator>
	  						<tr>
	  							<td>
	  							<s:if test="#qTitle.isCheckBox == 1">
									<input type="checkbox" name="<s:property value="#qTitle.id"/>" value="-1" />
								</s:if>
								<s:elseif test="#qTitle.isCheckBox == 0">
									<input type="radio" name="<s:property value="#qTitle.id"/>" value="-1"/>
								</s:elseif>
	  								<!-- <input type="radio" name="#qTitle.id" value="-1"/> -->其他，请说明
	  								<input type="text" id="<s:property value="#qTitle.id"/>" name="<s:property value="#qTitle.id"/>"/>
	  							</td>
	  						</tr>
							</table>
						</td>
						<td valign="top">
							<table border="0">
							<s:iterator value="%{#qTitle.audienceQs}" id="audienceq" status="status">
							<tr>
							<td>
								<s:if test="#audienceq.isAvalible==1&&#status.index%2!=0">
								<s:if test="#qTitle.isCheckBox == 1">
									<input type="checkbox" value="<s:property value="#audienceq.id"/>" name="<s:property value="#qTitle.id"/>">
								</s:if>
								<s:elseif test="#qTitle.isCheckBox == 0">
									<input type="radio" value="<s:property value="#audienceq.id"/>" name="<s:property value="#qTitle.id"/>"/>
								</s:elseif>
								<!-- <s:property value="#status.index"/>
								<s:property value="#qTitle.id"/> --> 
	  							<s:property value="%{#audienceq.Qtext}"/>  
	  							</s:if>
							</td>
							</tr>
							</s:iterator>
							</table>
						</td>
						</tr>
				</table>
			</td>
  		</tr>
  		</s:iterator>
  		<!-- 
  		<tr>
			<td colspan="2" align="left" bgcolor="#FFFFCC" style="fontblack" height="40px">
				推荐我的朋友<br/>
				我希望邀请我的 
				<select name="EmailCount" id="EmailCount" style="width:50px" onchange="checkEmails(this.options[this.selectedIndex].value)">
			        <option value="1">1</option>
			        <option value="2">2</option>
			        <option value="3">3</option>
			        <option value="4">4</option>
			        <option value="5">5</option>
		      	</select>
				 位朋友参加展览会。 
			</td>
		</tr>
		<tr>
      		<td bgcolor="#FFFFFF" style="fontblack">对方E-Mail地址</td>
      		<td bgcolor="#FFFFFF" id="Emails"><input type="text" name="ToEmail1" id="ToEmail1" /></td>
   		</tr>
   		<!-- 
    	<tr bgcolor="#FFFFFF">
    	<td colspan="2" align="center">
    	<input name="version" type="hidden" id="version" value="Chinese" />
    	<input name="button" type="submit" id="btnSubmit"  value=" 确认无误，提交信息 " class="MyButton"  style="width:200px"/>
    	</td>
    	</tr>
		 -->
   </table>
   </form>
   <iframe src="${pageContext.request.contextPath}/preAudienceAction!toIndexPage.action?source=${showInfo.urlChannel}&pageName=footer" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" width="100%" height="50"></iframe>
   </center>

  </body>
</html>
